import {useState} from 'react'

function Btn() {
  const [num,setNum] = useState(1)
  return ( <button onClick={()=>setNum(num+1)}>{num}</button> );
}

export default Btn;
// 用function声明的组件称为函数组件